package org.zfes.snowier.cloud.zbss.metting.router.service.tenant;

import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.metting.biz.dto.MettingsNotifyCreateDto;
import org.zfes.snowier.cloud.zbss.metting.biz.model.MettingsNotify;
import org.zfes.snowier.cloud.zbss.metting.biz.service.IMettingsNotifyService;
@Controller("org.zfes.snowier.cloud.zbss.metting.router.service.tenant.MettingsNotifyController")  
@RequestMapping("/met/service/tenant/mettingsNotify")
public class MettingsNotifyController extends BaseController {

	
	@Autowired
	private IMettingsNotifyService mettingsNotifyService;
	
    @RequestMapping(value="/loadMettingsNotifyDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsNotifyDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  mettingsNotifyService.loadMettingsNotifyDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
    @RequestMapping(value="/createMettingsNotify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createMettingsNotify(MettingsNotifyCreateDto notifyCreateDto){
		mettingsNotifyService.createMettingsNotify( SecurityUtil.getUserId().get(),SecurityUtil.getUserName().get(), notifyCreateDto);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/loadMettingsNotify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsNotify(Long id){
		Optional<MettingsNotify> ops = mettingsNotifyService.loadMettingsNotifyById(id);
		return ajaxQuery("mettingsNotify",ops);
    }
	
    @RequestMapping(value="/updateMettingsNotify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateMettingsNotify(MettingsNotify mettingsNotify){
		mettingsNotifyService.updateMettingsNotify(mettingsNotify);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/deleteMettingsNotify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteMettingsNotify(Long id){
		mettingsNotifyService.deleteMettingsNotify(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}